<template>
    <h2 style="text-align: center;">列表显示页面</h2>
    <table class="table">
        <tbody>
            <tr>
                <td>用户名</td>
                <td>密码</td>
                <td>类别</td>
                <td>操作</td>
            </tr>
            <tr v-for="item in showlist" :key="item.uid">
                <td>{{item.name}}</td>
                <td>{{item.password}}</td>
                <td>{{item.type}}</td>
                <td>
                    <a @click="tiaozhuan">跳转添加页面</a>
                </td>
            </tr>
        </tbody>
    </table>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import axios from 'axios';
import "bootstrap/dist/css/bootstrap.min.css"
import router from '@/router';


const Show = () => {
    axios.get("https://localhost:7230/api/User/Show").then(res => {
        showlist.value = res.data;
    })
}

const tiaozhuan = () => {
    router.push("/addlist")
}

const showlist =ref([])

onMounted(() => {
    Show();
})

</script>